<template>
	<div id="purse">
		<div class="purse_area">
			<div class="top_area my-flex-between">
				<div class="">
					<span>余额：¥{{totalBalance}}</span>
					<span @click="changeRouter('/purserecord')">查看明细></span>
				</div>
				<div class="right_btn my-flex-left">
					<div class="btns my-flex-center" @click="rechargeType(1)">
						充值
					</div>
					<div class="btns my-flex-center" @click="rechargeType(2)">
						提现
					</div>
				</div>
			</div>
			<div class="card_list_area">
				<div class="cards_items">
					<div class="card_option" v-for="(item,shopindex) in tableData">
						<!--<label class="mark_types  my-flex-left">
							<input name="mark" type="radio" value="1" />
							<span></span>
						</label>-->
						<div class="right_content">
							<div class="companyname">
								{{item.userName}}
							</div>
							<div class="money_total my-flex-col-center">
								<div class="text">
									余额
								</div>
								<div class="money">
									¥{{item.balance}}
								</div>
							</div>
						</div>
					</div>

				</div>
				<v-empty v-if="tableData.length==0"></v-empty>

			</div>
		</div>

	</div>
</template>

<script>
	import service from '@/js/services/walletservice.js';
	export default {
		inject: ['reload', 'closeLoading', 'openLoading', 'hasPermission'],
		data() {
			return {
				currrentId: 5,
				totalBalance: 0,
				tableData: [],
				bankList: [],
				params: {
					pageNum: 1,
					pageSize: 30
				},

			}
		},
		mounted() {
			this.myWallet();
			this.getbanks();
		},
		methods: {
			...service,
			changeRouter(url) {
				this.$router.push(url);
			},
			rechargeType(type) {
				let self = this;
				let id = type;
				if(this.bankList.length > 0) {
					this.$router.push({
						path: '/wallet/recharge',
						query: {
							type: id,
						}
					});
				} else {
					this.$message('您还未绑定银行卡，请先去绑定银行卡！');
					return;
				}
			},
		}
	}
</script>

<style lang="less" src="../../less/page/purse/index.less"></style>